package com.atguigu.day05;

import java.util.Arrays;
import java.util.Scanner;

public class Test09 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);

        System.out.println("请输入人数:");
        int count = s.nextInt();
        double[] d = new double[count];
        for (int i = 0; i < count; i++) {
            System.out.println("请输入" + (i + 1) + "号的成绩:");
            d[i] = s.nextDouble();
        }
        double bet = d[0];
        for (int j = 0; j < count; j++) {
            for (int i = 0; i < count - 1 - j; i++) {
                if (d[i] < d[i + 1]) {
                    bet = d[i + 1];
                    d[i + 1] = d[i];
                    d[i] = bet;
                }
            }
        }
        System.out.println(Arrays.toString(d));
    }
}